package config

import (
	"fmt"
	"github.com/spf13/viper"
)

type Config struct {
	Mysql Mysql
	Redis Redis
}
type Redis struct {
	Host     string
	Password string
}
type Mysql struct {
	User     string
	Password string
	Host     string
	Database string
}

type Dev struct {
	QiLiu QiLiu
}
type QiLiu struct {
	Ak     string
	Sk     string
	Bucket string
	Url    string
}

var AppConf Config
var DevConf Dev

func ConfigInit() {
	viper.SetConfigFile("../config/config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppConf)
	fmt.Println(AppConf)
}
func DevConfigInit() {
	viper.SetConfigFile("../config/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&DevConf)
	fmt.Println(DevConf)
}
